package com.project.design.factory.simpleFactory;

/**
 * 简单工厂模式  违背了开闭原则
 */
public class SimpleFactory {

    final class Const {
        static final int PRODUCT_A = 0;
        static final int PRODUCT_B = 1;
        static final int PRODUCT_C = 2;
    }

    public static Product makeProduct(int k) {
        switch (k) {
            case Const.PRODUCT_A:
                return new ConcreteProductOne();
            case Const.PRODUCT_B:
                return new ConcreteProductTwo();
            default:
                return null;
        }
    }
}
